#ifndef __STDAFX_H__
#define __STDAFX_H__
#include "Common.h"
#ifdef _WIN32

#define CPPCONN_DONT_TYPEDEF_MS_TYPES_TO_C99_TYPES

#define WIN32_LEAN_AND_MEAN

#include <tchar.h>
#include <windows.h>
#include <winsock2.h>
#include <io.h>
#include <direct.h>

#pragma warning(disable : 4100 4189 4390)

#pragma comment(lib, "Ws2_32.lib")

#else

#include <sys/socket.h>
#include <sys/time.h>
#include <netinet/in.h>
#include <fcntl.h>
#include <asm/ioctls.h>

#include <pthread.h>
#include <semaphore.h>

#include <sys/io.h>
#include <errno.h>
//#include <atomic>

#endif

#include <time.h>
#include <sys/stat.h>
#include <string.h>
#include <typeinfo>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <memory>
#include <boost/functional.hpp>
#include <boost/function.hpp>
#include <boost/bind.hpp>
#include <algorithm>
#include <iostream>
#include <fstream>
#include <sstream>

namespace std
{
	using namespace boost;
}

#ifndef _WIN32

namespace std
{
	using namespace __gnu_cxx;
}

#endif


#ifndef _WIN32

namespace std
{
	using namespace __gnu_cxx;
}

typedef Int64 __int64;
typedef Int32 SOCKET;

#define _CrtCheckMemory(x)		(1)

#define strcpy_s				strcpy
#define sprintf_s 				sprintf
#define sscanf_s				sscanf
//#define auto_ptr				unique_ptr

#define _ASSERT(x)				assert(x)
#define MAX_PATH				512
#define SOCKET_ERROR			-1
#define INVALID_SOCKET			-1
#include <stdio.h>   
#include <stdarg.h>
#endif

#include <time.h>
#include <sys/stat.h>
#include <string.h>
#include <typeinfo>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <memory>
#include <boost/functional.hpp>
#include <boost/function.hpp>
#include <boost/bind.hpp>
#include <algorithm>
#include <iostream>
#include <fstream>
#include <sstream>

#include "Network.h"
#include "Config.h"
#include "DataBlock.h"
#include "PacketDecoder.h"
#include "PacketEncoder.h"
#include "PacketDispatcher.h"
#include "TimerHandler.h"
#include "TimerManager.h"
#include "Common.h"

#include "Peer.h"
#include "PeerManager.h"
#include "GateServer.h"
#include "ClientCallbackGame.h"
#include "ServerCallbackGate.h"





#ifdef _WIN32
#define LOGGER_STD_OUTPUT
#endif
#define LOGGER_FILE_OUTPUT
#define LOGGER_OUTPUT "GateServer"
#include "Logger.h"

#ifdef _WIN32
#pragma comment(lib, "Common_d.lib")
#else
#pragma comment(lib, "Common.lib")
#endif

#endif